	$(function () {
		$('.sidebar-menu').tree();
		$(".btn-back").click(function () {
			window.history.back();
		});
	});

	var  menuJson = JSON.parse($("#sys_menuJson").val());
	function menuInit() {
		var menu = null;
		var html = null;
		var chidLen = null;
		var child = null;
		for (var i = 0; i < menuJson.length; i++) {
		    menu = menuJson[i];

		    if(menu.childList){
			html = $(' <li menu-id="' + i + '" class="treeview "><li>');
			$(".sidebar .sidebar-menu").append(html);

			html = $(' <a href="'+menu.url+'"> <i class="fa '+menu.icon+'"></i> <span>'+menu.permissionName +'</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul menuUl-id="'+i+'" class="treeview-menu"> </ul>');
			$('[menu-id="'+i+'"]').append(html);

			chidLen = menu.childList.length;
			for (var j=0;j<chidLen;j++){
				child = menu.childList[j];
				var childLiId = child.percode.split(":")[1];
				html = $('<li id="'+childLiId+'"><a href="'+child.url+'"><i class="fa  '+child.icon+'"></i> '+child.permissionName+'</a></li>');
				$('[menuUl-id="'+i+'"]').append(html);
			}
		    }
		    else{
			html = $('<li  menu-id="' + i + '"><a href="' + menu.url+'"><i class="fa ' + menu.icon+'"></i> <span>' +menu.permissionName+'</span></a></li>');
			$(".sidebar .sidebar-menu").append(html);
		    }

		}
	}
	menuInit();

	// 展开具体的导航
	var activeInput = $("#sys_activeInput").val();
	$("#"+activeInput).addClass("active");
	$("#"+activeInput).parent().parent().addClass("active");
